/**
 * @License: (C) Copyright 2013-2022
 * @Contact: abcque@outlook.com
 * @IDE: IntelliJ IDEA
 * @Encoding: utf-8
 * @Project: st2214st2215
 * @Package: PACKAGE_NAME
 * @File: Stats.java
 * @Time: 2023/4/11 15:24
 * @Author: abcque
 * @Description:
 * @Modifier:
 * @ModifyDate:
 * @ModifyRemark:
 */
public class Stats<T extends Number> {
    T[] arr;

    public Stats(T[] arr) {
        this.arr = arr;
    }

    public double average(){
        double sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum = sum + arr[i].doubleValue();
        }
        return sum / arr.length;
    }
}
